package com.bskj.common.enums;

/**
 * 用户账户金额变更类型
 * 
 * @author lishi
 * @date 2017-11-30 下午8:41:37
 */
public enum UserMoneyChangeTypeEnum {
	ADD(1, "增加"), DEL(2, "减少");

	private int key;
	private String value;

	private UserMoneyChangeTypeEnum(int key, String value) {
		this.key = key;
		this.value = value;
	}

	public int getKey() {
		return key;
	}

	public void setKey(int key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	public static UserMoneyChangeTypeEnum getType(int key) {
		for (UserMoneyChangeTypeEnum type : UserMoneyChangeTypeEnum.values()) {
			if (type.getKey() == key) {
				return type;
			}
		}
		return null;
	}
}
